<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>自增自减实战</title>
</head>
<body>
<script>
    //第一题
    var n1=10,n2=20;
    var n=n1++;//n=10 n1=11
    console.log("n="+n);//10
    console.log("n1="+n1);//11
    //第二题 接上题
    var n=++n1;//n=12 n1=12
    console.log("n="+n);//12
    console.log("n1="+n1);//12
    //第三题接上题
    var n=n2--;//n=20 n2=19
    console.log("n="+n);//20
    console.log("n2="+n2);//19
    //第四题接上题
    var n=--n2;//n=18  n2=18
    console.log("n="+n);//18
    console.log("n2="+n2);//18
</script>
</body>
</html>